class Product {
  constructor(name) {
    this.name = name
  }
  init() {
    console.log('init')
  }
  fun1() {
    console.log('fn1')
  }
  fun2() {
    console.log('fn2')    
  }
}

class Creator {
  create(name) {
    return new Product(name)
  }
}

// 测试
let create = new Creator()
let p = create.create('p1')
p.init()
p.fun1()